
<template>
    <van-form @submit="onSubmit">
        <van-cell-group inset>
            <van-field
                    v-model="editObject.currentValue"
                    :name="editObject.editKey"
                    :label="editObject.editName"
                    :placeholder="`请输入${editObject.editName}`"
                    :rules="[{ required: true, message: '请填写'+editObject.editName }]"
            />
        </van-cell-group>
        <div style="margin: 16px;">
            <van-button round block type="primary" native-type="submit">
                确认修改
            </van-button>
        </div>
    </van-form>
</template>

<script setup lang="ts">
  import {useRoute} from "vue-router";
  import {ref} from "vue";

  const route = useRoute();

  const editObject = ref({
      editKey: route.query.editKey,
      editName: route.query.editName,
      currentValue: route.query.currentValue
  });


  const onSubmit = (values) => {
      console.log('submit', values);
  };
</script>

<style scoped>

</style>